import vue from 'vue'
import VueRouter from 'vue-router'
vue.use(VueRouter)
const routes = [{
        path: '/',
        component: () => import("@/newproject/home/home.vue")
    },
    {
        path: "/yuesao",
        component: () => import("@/newproject/yuesao/home.vue")
    },
    {
        path: "/baojie",
        component: () => import("@/newproject/yuesao/baojie.vue")
    },
    {
        path: "/jiazhen",
        component: () => import("@/newproject/yuesao/jiazhen.vue")
    },
    {
        path: "/person",
        component: () => import("@/newproject/personal/home.vue"),
        meta: {
            islogin2: true
        },
    },
    {
        path: '/login',
        component: () => import("@/backstage/login.vue")
    },
    {
        path: '/brief',
        component: () => import("@/components/brief.vue")
    },
    {
        path: '/personal',
        component: () => import("@/components/personal.vue"),
        meta: {
            islogin2: true
        },
        children: [
            // {
            //     path: '/recommend',
            //     component: () => import("@/filsh/recommend.vue"),
            //     meta: {
            //         islogin2: true
            //     },
            // },
            {
                path: '/order1',
                component: () => import("@/newproject/order/order1.vue"),
                meta: {
                    islogin2: true
                },
            },
            {
                path: '/worker',
                name: "Worker",
                component: () => import("@/components/personlist/Worker.vue"),
                meta: {
                    islogin2: true
                },
            },
            {
                path: '/order',
                name: "agent",
                component: () => import("@/components/order.vue"),
                meta: {
                    islogin2: true
                },
            },
            {
                path: '/moreinfo',
                name: 'moreinfo',
                component: () => import("@/filsh/moreinfo.vue"),
                meta: {
                    islogin2: true
                },
            },
            {
                path: '/order2',
                component: () => import("@/filsh/order.vue"),
                meta: {
                    islogin2: true
                },
            },
            {
                path: '/comments',
                component: () => import("@/filsh/comments.vue"),
                meta: {
                    islogin2: true
                },
            },
            {
                path: '/release',
                component: () => import("@/filsh/release.vue"),
                meta: {
                    islogin2: true
                },
            },
            {
                path: '/successone',
                component: () => import("@/filsh/successone.vue"),
                meta: {
                    islogin2: true
                },
            },
            {
                path: '/successtwo',
                component: () => import("@/filsh/successtwo.vue"),
                meta: {
                    islogin2: true
                },
            },

        ]
    },
    {
        path: '/about',
        name: 'About',
        component: () => import('../views/About.vue')
    },
    {
        path: '/workUserList',
        name: 'workUserList',
        component: () => import('../views/workUserList.vue')
    },
    {
        path: '/zhuce',
        name: 'Zhuce',
        component: () => import('../views/Zhuce.vue')
    },
    {
        path: '/forget',
        name: 'Forget',
        component: () => import('../views/Forget.vue'),
        meta: {
            islogin2: true
        },
    },
    {
        path: '/user',
        name: 'User',
        component: () => import('../views/User.vue')
    },
    {
        path: '/staff',
        name: 'Staff',
        component: () => import('../views/Staff.vue')
    },
    {
        path: "/backstage",
        component: () => import("@/backstage/back_home.vue"),
        meta: true,
        children: [{
                path: '/',
                component: () => import("@/backstage/home.vue"),
                meta: {
                    islogin: true
                }
            },
            {
                path: "/personmsg",
                component: () => import("@/backstage/personmsg.vue"),
                meta: {
                    islogin: true
                }
            },
            {
                path: "/0-0",
                component: () => import("@/backstage/childrenview/manage01.vue"),
                meta: {
                    islogin: true
                }
            },
            {
                path: "/0-1",
                component: () => import("@/backstage/childrenview/manage02.vue"),
                meta: {
                    islogin: true
                }
            },
            {
                path: "/0-2",
                component: () => import("@/backstage/childrenview/manage03.vue"),
                meta: {
                    islogin: true
                }
            },
            {
                path: "/0-3",
                component: () => import("@/backstage/childrenview/manage04.vue"),
                meta: {
                    islogin: true
                }
            },
            {
                path: "/1-0",
                component: () => import("@/backstage/childrenview/monitor01.vue"),
                meta: {
                    islogin: true
                }
            },
            {
                path: "/1-1",
                component: () => import("@/backstage/childrenview/monitor02.vue"),
                meta: {
                    islogin: true
                }
            },
            {
                path: "/1-2",
                component: () => import("@/backstage/childrenview/monitor03.vue"),
                meta: {
                    islogin: true
                }
            }
        ]
    }
]
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}
const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router